Filter hook 'get_the_generator_{$type}'

in WP Core File wp-includes/general-template.php at line 5211

View Source

get_the_generator_{$type}

Filter Hook
Description
Filters the HTML for the retrieved generator type. The dynamic portion of the hook name, `$type`, refers to the generator type. Possible hook names include: - `get_the_generator_atom` - `get_the_generator_comment` - `get_the_generator_export` - `get_the_generator_html` - `get_the_generator_rdf` - `get_the_generator_rss2` - `get_the_generator_xhtml`

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 5211

Hook Parameters

Type Name Description
string $gen The HTML markup output to wp_head().
string $type The type of generator. Accepts 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.

Usage Examples

Basic Usage
<?php
// Hook into get_the_generator_{$type}
add_filter('get_the_generator_{$type}', 'my_custom_filter', 10, 2);

function my_custom_filter($gen, $type) {
    // Your custom filtering logic here
    return $gen;
}

Source Code Context

wp-includes/general-template.php:5211 - How this hook is used in WordPress core
<?php
5206  	 *
5207  	 * @param string $gen  The HTML markup output to wp_head().
5208  	 * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom',
5209  	 *                     'rss2', 'rdf', 'comment', 'export'.
5210  	 */
5211  	return apply_filters( "get_the_generator_{$type}", $gen, $type );
5212  }
5213  
5214  /**
5215   * Outputs the HTML checked attribute.
5216   *

PHP Documentation

<?php
/**
	 * Filters the HTML for the retrieved generator type.
	 *
	 * The dynamic portion of the hook name, `$type`, refers to the generator type.
	 *
	 * Possible hook names include:
	 *
	 *  - `get_the_generator_atom`
	 *  - `get_the_generator_comment`
	 *  - `get_the_generator_export`
	 *  - `get_the_generator_html`
	 *  - `get_the_generator_rdf`
	 *  - `get_the_generator_rss2`
	 *  - `get_the_generator_xhtml`
	 *
	 * @since 2.5.0
	 *
	 * @param string $gen  The HTML markup output to wp_head().
	 * @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom',
	 *                     'rss2', 'rdf', 'comment', 'export'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.